var app = getApp();
Page({
  data: {
    param: {},
    page: 1,
    loadingFlag: false,
    categories: [
      {
        id: '5',
        name: "A1",
      },
      {
        id: '5',
        name: "A2",
      },
      {
        id: '5',
        name: "A3",
      },
      {
        id: '5',
        name: "B1",
      },
      {
        id: '5',
        name: "B2",
      },
      {
        id: '1',
        name: "C1",
      },
      {
        id: '2',
        name: "C2",
      },
      {
        id: '3',
        name: "C3",
      },
      {
        id: '4',
        name: "C4",
      }],
    activeCategoryId: 0,
    navbar_bgcolor: wx.getStorageSync('navbar_bgcolor')
  },
  onLoad: function (cate) {
    var that = this;
    if (cate && cate.id) {
      that.data.param.categId = parseInt(cate.id);
    }
  },
  tabClick: function (e) {
    this.setData({
      activeCategoryId: e.currentTarget.id
    });

    var param = e.currentTarget.dataset;
    var name = param["name"];


    // 存储数据
    let pagetotal = getCurrentPages() //所有的路径 数组
    let parpage = pagetotal[pagetotal.length - 2] //父级页面

    parpage.setData({
      chexing: name
    })


    wx.navigateBack({
      delta: 1
    });


  },
  onReachBottom: function () {
  }
})